resource "aws_vpc" "main" {
  tags = {
    Name = var.vpc_name
    Tag  = var.vpc_tag
  }
  cidr_block = var.cidr_block
}

resource "aws_subnet" "main" {
  count      = var.subnet_cidrs_count
  vpc_id     = aws_vpc.main.id
  cidr_block = var.subnet_cidrs[count.index]
  availability_zone = var.availability_zones[count.index]
}

output "vpc_id" {
  value = aws_vpc.main.id
}

output "subnet_ids" {
  value = aws_subnet.main[*].id
}

